
class MacOs(object):

    name: str

    def __init__(self, version):
        self.version = version

    def print_info(self):
        print(f'打印基础信息 version:{self.version} class:{type(self)}')



class IPad(MacOs):

    def __init__(self, version, color):
        super().__init__(version)
        self.name = 'IPad'
        self.color = color

    def call(self, phone_num):
        print(f'Call to {phone_num}, come from {self.name} {self.version}')



class IPhone(MacOs):

    def __init__(self, version, color):
        super().__init__(version)
        self.name = 'IPhone'
        self.color = color

    def call(self, phone_num):
        print(f'Call to {phone_num}, come from {self.name} {self.version}')

    def print_info(self):
        print(f'我重新了父类的方法 {self.name}')



ipad = IPad('16.1', 'Blue')
iphone = IPhone('15.8', 'Red')

ipad.call('18021547925')
ipad.print_info()
iphone.call('18068830290')
iphone.print_info()